using Quartz;
using Vin.Extension.Framework.Quartz.Jobs;
using Vin.Extension.Framework.Quartz.Models;

namespace Vin.Extension.Framework.Quartz.ServiceInterface;

public interface IVinJobService
{
    Task<bool> AddAsync<T>(string redisJobMapKey, string businessId, JobInfo jobInfo) where T : VinBaseJob;
    
    Task<bool> RemoveAsync(string redisJobMapKey, string businessId);
    
    Task<long> StartAsync(JobInfo info);

    Task<long> StartAsync(string name, string groupName, Dictionary<string, string>? parameters = null);

    Task<long> StartAsync<T>(JobInfo info) where T : IJob;

    Task<long> StartAsync<T>(string name, string groupName, Dictionary<string, string>? parameters = null)
        where T : IJob;
    
    Task<bool> StopAsync(long id);
    
    Task<bool> DelAsync(long id);
}